//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_kbsendmsgall.sqf"
#include "x_setup.sqf"

#ifndef __TT__
private "_kbsound";
_kbsound = if (count _this > 2) then {_this select 2} else {[]};
GVAR(kb_logic1) kbTell [GVAR(kb_logic2),GVAR(kb_topic_side),_this select 0,["1","",_this select 1,_kbsound],"GLOBAL"];
#else
private "_kbsound";
_kbsound = if (count _this > 3) then {_this select 3} else {[]};
if ((_this select 0) == "") then {
	GVAR(hq_logic_en1) kbTell [GVAR(hq_logic_en2),"HQ_W",_this select 1,["1","",_this select 2,_kbsound],"SIDE"];
	GVAR(hq_logic_ru1) kbTell [GVAR(hq_logic_ru2),"HQ_E",_this select 1,["1","",_this select 2,_kbsound],"SIDE"];
} else {
	switch (_this select 0) do {
		case "HQ_W": {GVAR(hq_logic_en1) kbTell [GVAR(hq_logic_en2),"HQ_W",_this select 1,["1","",_this select 2,_kbsound],"SIDE"]};
		case "HQ_E": {GVAR(hq_logic_ru1) kbTell [GVAR(hq_logic_ru2),"HQ_E",_this select 1,["1","",_this select 2,_kbsound],"SIDE"]};
	};
};
#endif